\documentclass[tikz,border=2mm]{standalone}
\usepackage{array,amsmath,mathptmx,xcolor,bbding,pifont,colortbl}
\usepackage[UTF8]{ctex}
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}}
% 只需要这个就可以
\usepackage[thicklines]{cancel}
% 可以设置线条颜色，默认是黑色
\usepackage{xcolor}
\usepackage{tikz-cd}
\usepackage{tikz,graphicx,subfig,caption} % Required for drawing custom shapes
\usetikzlibrary{fit,matrix,chains,arrows,shapes,positioning,arrows.meta,chains,shadows,shapes.callouts,decorations.text,shapes.symbols,shapes.misc, positioning,decorations.pathreplacing,calc,backgrounds,}

% 额外添加
\usepackage{indentfirst}
\usepackage{diagbox}
\usepackage{amssymb}
\usepackage{pifont}

\begin{document} 
	\begin{tikzpicture}[>=latex,every node/.style={anchor=south west,,inner sep=0,fill=white}]
		
		\node(enter)[draw, rounded rectangle, anchor=north,align=left, fill=white, inner sep=0.3em] at (0,0){\ \ 入口\ \ }; 
		\node(select1)[draw, diamond,aspect=2, anchor=north,align=left,fill=white,inner sep=0.3em] at ([xshift=0em,yshift=-1.2em]enter.south){ $c?$ }; 
		\node(next1)[anchor=north,align=left,fill=white,inner sep=0.3em] at ([xshift=0em,yshift=-1.2em]select1.south){NEXT(w)}; 
		\node(select2)[draw, diamond,aspect=2, anchor=north,align=left,fill=white,inner sep=0.3em] at ([xshift=0em,yshift=-1.2em]next1.south){ $d?$ }; 
		\node(next2)[anchor=north,align=left,fill=white,inner sep=0.3em] at ([xshift=0em,yshift=-1.2em]select2.south){NEXT(w)}; 
		\node(end)[draw, rounded rectangle, anchor=north,align=left, fill=white, inner sep=0.3em] at ([xshift=0em,yshift=-1.2em]next2.south){\ \ 出口\ \ }; 
		
		\draw[->] (enter.south) -- (select1.north);
		\draw[->] (select1.south) -- (next1.north);
		\draw[->] (next1.south) -- (select2.north);
		\draw[->] (select2.south) -- (next2.north);
		\draw[->] (next2.south) -- (end.north);
		\draw[-] (select1.east) -| ([xshift=3em,yshift=-5em]select1.east);
		\draw[->] ([xshift=3em,yshift=-5em]select1.east) |- ([xshift=0em,yshift=-0.6em]next2.south);
		
		\draw[->] (select1.east) -- ([xshift=2em,yshift=0em]select1.east);
		\draw[->] (select2.east) -- ([xshift=2em,yshift=0em]select2.east);
		
		\node(n1)[anchor=north,align=left,fill=white,inner sep=0em] at 
		([xshift=1em,yshift=0.6em]select1.east){n}; 
		\node(n2)[anchor=north,align=left,fill=white,inner sep=0em] at 
		([xshift=1em,yshift=0.6em]select2.east){n}; 
		\node(y1)[anchor=north,align=left,fill=white,inner sep=0em] at 
		([xshift=0.6em,yshift=-0.3em]select1.south){y}; 
		\node(y2)[anchor=north,align=left,fill=white,inner sep=0em] at 
		([xshift=0.6em,yshift=-0.3em]select2.south){y}; 
		\node(y3)[anchor=north,align=left,fill=white,inner sep=0em] at 
		([xshift=1.6em,yshift=-0.3em]select2.east){err3}; 
		\node(tip)[anchor=north,align=left,fill=white,inner sep=0em] at 
		([xshift=3.7em,yshift=-2em]select1.east){遇\\
			$\varepsilon$ \\
			时}; 
	\end{tikzpicture}
\end{document}
